<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitionaldtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="C:\xampp\htdocs\project\Templates\editor.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Trang Editor</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" --> 
<script type="text/javascript">
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} 
}
</script>
<!-- InstanceEndEditable -->
<link rel="stylesheet" type="text/css" href="../css/admincss.css"/>
<link rel="icon" href="images/icon.jpg">
<script type="text/javascript" src="../SpryAssets/SpryValidationTextField.js"></script>
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../SpryAssets/SpryValidationTextField.css"/>
<link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div id="wrapper">
  <div id="header"> 
    <div id="dk">
    <br />

    <form id="form1" name="form1" method="post" action="../project/dk/xuly.php">
  <table width="272" border="0">
    <tr>
      <td width="93">Tài khoản:</td>
      <td width="169"><label for="texttaikhoan"></label>
      <input type="text" name="texttaikhoan" id="texttaikhoan" /></td>
    </tr>
    <tr>
      <td>Mật khẩu:</td>
      <td><label for="textmatkhau"></label>
      <input type="password" name="textmatkhau" id="textmatkhau" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="buttondn" id="buttondn" value="Đăng nhập" /><input type="submit" name="buttondx" id="buttondx" value="Đăng xuất" /></td>
    </tr>
  </table>
</form>
  </div>
    <div id="top-header" class="clearfix">
        <a href="#" id="logo" class="clearfix">
           <img src="../images/4468766.jpg">
      <h3>Tin <br/><span>Từng Giây</span></h3></a>
               
    </div>
  </div><hr />
  <p align="center" style="color:#3C6; font-size:24px;">Trang Editor:</p>
  <table width="979" border="1">
    <tr>
      <td width="339" height="289"><ul id="MenuBar2" class="MenuBarVertical">
        
          
            <li><a href="#" class="MenuBarItemSubmenu">Nguồn tin</a>
              <ul>
                <li><a href="thoisu.php">Thời sự</a></li>
                <li><a href="thethao.php">Thể thao</a></li>
                <li><a href="phapluat.php">Ph&aacute;p luật</a></li>
                <li><a href="giritri.php">Giải tr&iacute;</a></li>
                <li><a href="doisong.php">&#272;ời sống</a></li>
                <li><a href="congnghe.php">C&ocirc;ng nghệ</a></li>
                <li><a href="khoahoc.php">Khoa học</a></li>
              </ul>
            </li>
            <li><a href="tinthanhvien.php">Tin từ th&agrave;nh vi&ecirc;n</a></li>
          </ul>
        </li>
</ul>      
      <td width="624"> <p style="font-size:18px">
		    <script type="text/javascript">
		
		document.getElementById('date').innerHTML = Date()</script>
	      </p>
        <p style="font-size:18px">&nbsp;</p>
        <!-- InstanceBeginEditable name="homnay" -->
      <?php
	  require_once('../project/dk/mysql.php');
	  if(isset($_POST['submit']))
	  {
	  	$r="INSERT INTO tintuc(IDtin,Tieude,IDUser,Tomtat,Noidung,Urlhinh,Urlvideo,Ngaydang,Tukhoa,Anhienthi,IDtheloai) VALUES('','".$_POST['tieude']."','".$_POST['user']."','".$_POST['tomtat']."','".$_POST['Noidung']."','".$_POST['urlhinh']."','".$_POST['urlvideo']."',NOW(),'".$_POST['tukhoa']."','".$_POST['anhien']."','".$_POST['theloai']."','1')" ;
		$q= mysqli_query($dbc,$r) or die(mysqli_error($dbc));
		if(mysqli_affected_rows($dbc))
		{
		echo "<script>
			alert('nhập dữ liệu thành công')
		 </script>";
		}
		
	  }
      ?>
     
      
      <form method="post" id="nhaptin"> 
      <?php
	  	
	  	$ngaytao;		
		$ngaydang;
		$anhien=range(0,1);
		if(isset($_POST['tieude2']))
		{
			$link = $_POST['tieude'];
		}
 
	?>
        <table width="636" border="1" id="bang1">
          <tr>
            <th width="254" height="28" scope="row">Tiêu đề</th>
            <td width="366"><label for="tieude"></label>
            <input style="width: 300px" name="tieude" id="tieude" cols="45" rows="5"></input>
            <input type="submit" name="tieude2" id="tieude2" value="Lấy tin" /></td>
            </tr>
          <tr>
            <th height="25" scope="row">Tóm tắt</th>
            <td><label for="tomtat"></label>
              <textarea name="tomtat" style="width: 366px" id="tomtat" cols="45" rows="5"></textarea></td>
            </tr>
          <tr>
            <th height="24" scope="row">Nội dung</th>
            <td><label for="Noidung"></label>
              <textarea name="Noidung" id="Noidung" style="width: 366px" cols="45" rows="5"></textarea></td>
            </tr>
          <tr>
            <th height="36" scope="row">Url Hình</th>
            <td><label for="urlhinh"></label>
              <input type="text" name="urlhinh" style="width: 366px" id="urlhinh" /></td>
            </tr>
          <tr>
            <th height="27" scope="row">Url Video</th>
            <td><label for="urlvideo"></label>
              <input type="text" style="width: 366px" name="urlvideo" id="urlvideo" /></td>
            </tr>
          <tr>
            <th height="27" scope="row">User</th>
            <td><label for="user"></label>
              <input type="text" style="width: 366px" name="user" id="user" /></td>
            </tr>
          <tr>
            <th height="29" scope="row">Từ khóa </th>
            <td><label for="tukhoa"></label>
              <input type="text" name="tukhoa" id="tukhoa" style="width: 366px" /></td>
            </tr>
          <tr>
            <th height="29" scope="row">Ẩn/ Hiện thị</th>
            <td>
  <span id="sprytextfield3">
  <label for="anhien"></label>
  <input type="text" name="anhien" id="anhien" />
  <span class="textfieldRequiredMsg">A value is required.</span></span> 0: ẩn/ 1: hiện thị</td>
            </tr>
          <tr>
            <td scope="row"><input type="reset" name="reset" id="reset" value="reset" /></td>
            <td><input name="submit" type="submit" id="submit" style="width:50px;float:right" onclick="MM_validateForm('urlhinh','','R','urlvideo','','R','tukhoa','','R','anhien','','RinRange0:1','tieude','','R','tomtat','','R','Noidung','','R');return document.MM_returnValue" value="Đăng" /></td>
            </tr>
          <tr>
          </table>
      </form><!-- InstanceEndEditable --></td>
      </tr>
    
  </table>
  <table>
  <tr>
      
      <td align="justify" width="973"><!-- InstanceBeginEditable name="main" -->
      <iframe style="width:979px; height: 500px" src="http://localhost:7070/project/lay%20tin/thegioi.php"></iframe><!-- InstanceEndEditable --></td>
      </tr>
  </table>

  <br />
<br />

<div id="footer" class="clearfix">
  <p>Tin từng giây có bản quyền thuộc về Nhóm 3 lớp C1406IV</p>
</div>
</div>
<script type="text/javascript"> 
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
<!-- InstanceEnd --></html>
